feat(gator-permissions-controller): Added redeemer rule#8537
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 94a0871. Configure here.
… improve error handling in decodeRedeemerEnforcerTerms
| ]; | ||
| } | ||
|
|
||
| return { isValid: true, expiry, data, rules }; |
There was a problem hiding this comment.
You had asked about why expiry is not in rules, and suggested that we move it there. I agree it makes sense, but is going to be a breaking change, so let's defer it for now (maybe raise a GH issue).
| }, | ||
| expiry, | ||
| origin: specifiedOrigin, | ||
| ...(rules === undefined ? {} : { rules }), |
There was a problem hiding this comment.
no change needed, but I wish there was a nicer way to do this natively in javascript. Maybe at some stage we can create a shared util (somewhere - @metamask/utils???) that we can use in all our codebases.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
| ### Changed | ||
|
|
||
| - Bump `@metamask/transaction-controller` from `^64.2.0` to `^64.4.0` ([#8482](https://github.com/MetaMask/core/pull/8482), [#8585](https://github.com/MetaMask/core/pull/8585)) | ||
| - Use `decodeRedeemerTerms` from `@metamask/delegation-core` instead of a local implementation ([#8537](https://github.com/MetaMask/core/pull/8537)) |
There was a problem hiding this comment.
nit: this is an internal consideration and probably doesn't need to appear in the changelog.
wenfix
left a comment
There was a problem hiding this comment.
approving changes on packages/eth-json-rpc-middleware/src/methods/wallet-get-supported-execution-permissions.test.ts

Explanation
Add a redeemer rule
{
"type": "redeemer",
"data: {
"addresses": Address[]
}
}
References
Checklist
Note
Medium Risk
Extends execution-permission decoding to accept an additional caveat and to emit a new
rulesfield, which can affect downstream consumers that assume a fixed decoded shape or strict caveat matching.Overview
Adds support for
RedeemerEnforceras an optional caveat across all execution permission types, decoding its packed-address terms into aredeemerrule (exported via newEXECUTION_PERMISSION_REDEEMER_RULE_TYPEandRedeemerRule).Updates permission decoding to propagate decoded
rulesthroughmakePermissionRule→validateAndDecodeResult→reconstructDecodedPermission→ controller output, and expands tests (includingwallet_getSupportedExecutionPermissions) to advertise/verify the newredeemerrule type and decoding behavior.Reviewed by Cursor Bugbot for commit 4744112. Bugbot is set up for automated code reviews on this repo. Configure here.